require(['./config'],()=>{
    require(['template','header'],(template)=>{
        class Category {
            constructor () {
                this.getList()
            }
            getList () {
                const id = location.search.slice(4)
                $.get(`http://www.xiongmaoyouxuan.com/api/tab/${id}`,resp=>{
                    console.log(resp)
                    if(resp.code===200){
                        const { list } = resp.data.items
                        const { cname } = resp.data.category
                        $('#goodsClassify').html(
                            template('classifyTemplate',{
                                cname,
                                list
                            })
                        )
                    }
                })
            }
        }
        new Category()
    })
})